Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AC_AttitudeControl: always use smaller of slew yaw and rate max #19735

Merged
merged 2 commits into from Jan 31, 2022

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Jan 8, 2022

We had a error on line 581:

ang_vel_limit(_ang_vel_target, radians(_ang_vel_roll_max), radians(_ang_vel_pitch_max), MIN(radians(_ang_vel_yaw_max), get_slew_yaw_rads()));

This was throwing away max slew yaw because _ang_vel_yaw_max defaults to zero. The same bug as was fixed in #18341

This adds some new methods to get max yaw rate and uses them in attitude control and copter auto yaw. Except for the bug fix above this should be no change in behavior.

@tridge
Copy link
Contributor

tridge commented Jan 24, 2022

waiting for review from @lthall

@rmackay9
Copy link
Contributor

If we could see some evidence of testing that would be great. thanks for this!

@IamPete1
Copy link
Member Author

made changes, rebased and stepped through with GDB, works as expected.

Copy link
Contributor

@lthall lthall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry Pete, Naming variables is a pain. slew_ang_vel_yaw_max is double redundant with both slew and ang_vel.

Lets just go with:
get_slew_yaw_max_degs()
get_slew_yaw_max_rads()
slew_yaw_max_rads

I apologise for sending you around again.

libraries/AC_AttitudeControl/AC_AttitudeControl.h Outdated Show resolved Hide resolved
libraries/AC_AttitudeControl/AC_AttitudeControl.h Outdated Show resolved Hide resolved
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp Outdated Show resolved Hide resolved
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp Outdated Show resolved Hide resolved
@rmackay9 rmackay9 merged commit 3189bd7 into ArduPilot:master Jan 31, 2022
@rmackay9
Copy link
Contributor

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants